<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
	<form id="form1" method="post">
        <div style="padding-left:30px;padding-bottom:10px;">
            <table style="table-layout:fixed;" cellspacing="0" cellpadding="5">
            	<tr>
            		<td style="width:120px;">产品名称：</td>
                    <td style="width:100px;">    
                        <input id="combo1" name="medicineId" class="mini-combobox" style="width:200px;" textField="name" valueField="id" emptyText="请选择..."
    						url="medical_medicine_view.do" required="true" allowInput="false" showNullItem="true" nullItemText="请选择..."/>
                    </td>
            	</tr>
            	<tr>
            		<td style="width:120px;">媒体名称：</td>
                    <td style="width:100px;">
                        <input id="combo2" name="mediaId" class="mini-combobox" style="width:200px;" textField="name" valueField="id" emptyText="请选择..."
    						url="medical_media_view_all.do" required="true" allowInput="false" showNullItem="true" nullItemText="请选择..."/>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">外线号码：</td>
                    <td style="width:100px;">
                        <input name="publishNumbers" class="mini-combobox" style="width:200px;" textField="outSideNum" valueField="outSideNum" emptyText="请选择..."
    						url="medical_mm_outline.do" required="true" allowInput="false" showNullItem="true" nullItemText="请选择..."/>
                    </td>
                </tr>
                <tr>
               		<td style="width:120px;">广告费用(元)：</td>
                    <td style="width:100px;">
                        <input name="costs" class="mini-textbox" required="true" vtype="float;maxLength:15" style="width: 200px"/>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">投放开始日期：</td>
                    <td style="width:100px;">    
                        <input name="placeStartTime"  class="mini-datepicker" required="true" style="width: 200px" showClearButton="false" allowInput="false"/>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">投放截止日期：</td>
                    <td style="width:100px;">    
                        <input name="placeEndTime"  class="mini-datepicker" required="true" style="width: 200px" showClearButton="false" allowInput="false"/>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">开始时间：</td>
                    <td style="width:100px;">    
                        <input name="startTime" class="mini-timespinner"  required="true" style="width: 200px" format="HH:mm:ss" />
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">结束时间：</td>
                    <td style="width:100px;">    
                        <input name="endTime" class="mini-timespinner"  required="true" style="width: 200px" format="HH:mm:ss" />
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">播放中：</td>
                    <td style="width:100px;">    
                        <input id="combo3" name="playing" class="mini-combobox" style="width:200px;" textField="keyValue" valueField="keyName" emptyText="请选择..."
    						url="medical_mm_key_value_view.do" required="true" allowInput="false" showNullItem="true" nullItemText="请选择..."/>
                    </td>
                </tr>
                <tr>
                    <td style="width:120px;">备注：</td>
                    <td colspan="3">    
                        <input name="description" class="mini-textarea" vtype="maxLength:255" style="width:200px;" />
                    </td>
                </tr>
            </table>
        </div>
        <div style="text-align:center;margin-top: 20px">               
            <a class="mini-button" onclick="onOk" style="width:60px;">确定</a>       
            <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>       
        </div>        
    </form>

<script type="text/javascript">
	mini.parse();
	
	var form = new mini.Form("form1");
	
	//保存数据
	function SaveData() {
	    var o = form.getData(true);
	    form.validate();
	    if (form.isValid() == false) return;
	    $.ajax({
	        url: "medical_media_place_save.do",
			type: 'post',
			dataType: 'json',
	        data: o,
	        cache: false,
	        success: function (text) {
	            if(text.success){
	            	window.CloseOwnerWindow("succ");
	            }else{
	            	mini.alert("数据错误！");
	            }
	        },
	        error: function (jqXHR, textStatus, errorThrown) {
	            alert(jqXHR.responseText);
	            window.CloseOwnerWindow();
	        }
	    });
	}
	
    function GetData() {
        var o = form.getData();
        return o;
    }
    
    function SetData(data){
	     data = mini.clone(data);
	     form.setData(data.row);
	}
    
    function CloseWindow(action) {            
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();            
    }
    
    function onOk(e) {
        SaveData();
    }
    
    function onCancel(e) {
        CloseWindow("cancel");
    }
    
</script>
</body>
</html>